<template>
  <el-select
    v-model.number="mySelectValue"
    :placeholder="placeholder"
    filterable
  >
    <el-option
      :label="item.label"
      :value="item.value"
      v-for="(item, index) in selectList"
      :key="index"
    ></el-option>
  </el-select>
</template>

<script>
export default {
  props: {
    selectValue: {
      required: true,
      default: ""
    },
    placeholder: {
      type: String,
      required: false,
      default: "请选择内容"
    },
    selectList: {
      type: [],
      required: true,
      default: () => [
        {
          label: "第一个选项",
          value: 0
        }
      ]
    }
  },
  computed: {
    mySelectValue: {
      get() {
        return this.selectValue
      },
      set(val) {
        this.$emit("update:selectValue", val)
      }
    }
  },
  methods: {}
}
</script>

<style lang="scss" scoped></style>
>
